/**
 * @file curl_post_to_bottle.hpp
 * @author gentech_lijun
 * @date 2015.12.13
 * @brief using libcurl send http post to python bottle server
 *
 * libcurl is a c/c++ third library, and bottle is a python third library
 */

#ifndef _CURL_POST_TO_BOTTLE_HPP_
#define _CURL_POST_TO_BOTTLE_HPP_

#include <curl/curl.h>
#include <string>

#pragma comment(lib, "libcurl.lib")

class CCurlPostToBottle
{
public:
        CCurlPostToBottle();

        ~CCurlPostToBottle();

        bool init();

        bool post(std::string &str_post_data);

private:
        CURL *p_curl_;
        struct curl_slist *p_slist_;
        CURLcode res_;
};

#endif // _CURL_POST_TO_BOTTLE_HPP_